package com.zjm.behavioral.observer.demo02;

/**
 * 观察者模式
 */
public class Client {
    public static void main(String[] args) {
        WeatherData weatherData = new WeatherData();

        // 创建观察者
        CurrentConditions currentConditions = new CurrentConditions();
        BaiduSite baiduSite = new BaiduSite();

        // weatherData注册观察者
        weatherData.registerObserver(currentConditions);
        weatherData.registerObserver(baiduSite);

        System.out.println("通知各个注册的观察者");
        weatherData.setData(20, 200, 90);
    }
}
